:: Use this batch file to schedule the powershell script
:: to import the changes to active directory.


:: Set location for Company Directory
y:
cd y:\applications\CompanyDirectory

:: Sets the environment variables for this batch file script
set MSACCESS="C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"
set db="%cd%\adupdate.accdb"


:: Call Microsoft Access to run Macro that export ShaerPoint
:: list to CSV file for importing to active directory.
%msaccess% %db% /excl /x mcr_Export


:: Powershell Script - Starts the script then it 
:: delete the csv file.
start /wait powershell %cd%\exportad.ps1
del %cd%\qry_Export.csv
